bitkeeper revision 1.1159.212.124 (42082d88aeY4pFTDqfgHMrvhse0-PA)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 8 Feb 2005 03:10:00 +0000 (03:10 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Tue, 8 Feb 2005 03:10:00 +0000 (03:10 +0000)
Fix to memory debugging audit code.

Signed-off-by: ian@xensource.com
xen/arch/x86/memory.c

index 6575f160c7d2718a92ec7cd34b8f5ddf62f0dab1..e9fa4b370eb7b81307003b76418d5dd7ba99d31c 100644 (file)
@@ -2313,7 +2313,6 @@ void audit_domain(struct domain *d)
     }
 
     /* PHASE 3 */
-
     list_ent = d->page_list.next;
     for ( i = 0; (list_ent != &d->page_list); i++ )
     {
@@ -2334,7 +2333,12 @@ void audit_domain(struct domain *d)
                 if ( pt[i] & _PAGE_PRESENT )
                 {
                     unsigned long l1pfn = pt[i]>>PAGE_SHIFT;
-                    struct pfn_info *l1page = &frame_table[l1pfn];
+                    struct pfn_info *l1page;
+
+                    if (l1pfn>max_page)
+                        continue;
+
+                    l1page = &frame_table[l1pfn];
 
                     if ( page_get_owner(l1page) == d )
                         adjust(l1page, 1, 1);
@@ -2355,7 +2359,12 @@ void audit_domain(struct domain *d)
                 if ( pt[i] & _PAGE_PRESENT )
                 {
                     unsigned long l1pfn = pt[i]>>PAGE_SHIFT;
-                    struct pfn_info *l1page = &frame_table[l1pfn];
+                    struct pfn_info *l1page;
+
+                    if (l1pfn>max_page)
+                        continue;
+
+                    l1page = &frame_table[l1pfn];
 
                     if ( (page_get_owner(l1page) != d) ||
                          (l1pfn < 0x100) || (l1pfn > max_page) )